import request from '../../../utils/request'

export function getDeviceList(type) {
  return request({
    url: `/cockpitapi/habitat/${type}/getDeviceList`,
    method: 'post'
  })
}

export function getAlarmList(type,deviceId,limit) {
  return request({
    url: `/cockpitapi/habitat/${type}/getAlarmList?deviceId=${deviceId}&limit=${limit}`,
    method: 'post'
  })
}

export function getCollectList(type,deviceId) {
  return request({
    url: `/cockpitapi/habitat/${type}/getCollectList?device_id=${deviceId}`,
    method: 'post'
  })
}

export function getPointList(type) {
  return request({
    url: `/cockpitapi/habitat/${type}/getPointList`,
    method: 'post'
  })
}

export function getCompareList(type,start_date,end_date,varName) {
  return request({
    url: `/cockpitapi/habitat/${type}/getCompareList?start_date=${start_date}&end_date=${end_date}&varName=${varName}`,
    method: 'post'
  })
}

export function getGroupVarList(type,params) {
  return request({
    url: `/cockpitapi/habitat/${type}/getGroupVarList`,
    method: 'post',
    data:params
  })
}

export function getHistoryList(type,start_date,end_date,varName) {
  return request({
    url: `/cockpitapi/habitat/${type}/getHistoryList?start_date=${start_date}&end_date=${end_date}&varName=${varName}`,
    method: 'post'
  })
}

export function getVarList(type,params) {
  return request({
    url: `/cockpitapi/habitat/${type}/getVarList`,
    method: 'post',
    data:params
  })
}